package com.hkemmm.company;

public class People {
    private int age;
    private String sex;
    private String name;
    public  int i = 2;

    public People(int age, String sex, String name){
        this.age = age;
        this.sex = sex;
        this.name = name;

        System.out.println("我People构造方法");
    }

    public People(){

    }

    //属性getter方法
    public int getAge() {
        return age;
    }

    public String getSex() {
        return sex;
    }

    public String getName() {
        return name;
    }

    //属性setter方法
    public void setAge(int age) {
        this.age = age;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public void setName(String name) {
        this.name = name;
    }



    //行为方法
    public void doEat(){
        System.out.println(this.name + "正在吃饭！！");
    }

    public void play(){
        System.out.println(this.name + "正在玩耍！！");
    }

    public void skill(){
        System.out.println("我是人们学会的技能！！");
    }


    //代码在构造方法执行完后执行，可以实现一些对类的初始化

    //类内部代码块，每次new时都会执行,子类构造方法调用父类构造方法时也会执行
    {
        System.out.println("我People内部代码块");
    }

    //静态内部的代码块，只会在编译时执行一次
    static {
        System.out.println("我People静态内部代码块");
    }
}
